<html>
<head><meta charset="utf-8"><title>Redundant requirements hidden notification · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Redundant.20requirements.20hidden.20notification.html">Redundant requirements hidden notification</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244051857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Redundant%20requirements%20hidden%20notification/near/244051857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> inquisitivecrystal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Redundant.20requirements.20hidden.20notification.html#244051857">(Jun 27 2021 at 06:08)</a>:</h4>
<p>Heyo! First off, I apologize if this isn't the right place to ask this question. Under certain circumstances involving recursive trait obligations, rustc recognizes that it would give redundant warnings and instead narrows them down to one. That would be great, except it also prints <a href="https://github.com/rust-lang/rust/blob/dbe459dedd33470f2cb28101157de316caaffa66/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs#L2206">a message saying that it's omitted warnings about redundant obligations</a>. I think that information isn't helpful and should be removed, since knowing that rustc has declined to give a warning is basically never helpful for an end user. However, I wanted to ask if I'm missing something before submitting a PR to change it.</p>



<a name="244100704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Redundant%20requirements%20hidden%20notification/near/244100704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> inquisitivecrystal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Redundant.20requirements.20hidden.20notification.html#244100704">(Jun 28 2021 at 04:23)</a>:</h4>
<p>Pinging <span class="user-mention" data-user-id="119031">@Esteban Küber</span>, who I believe was involved with implementing this.</p>



<a name="244165574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Redundant%20requirements%20hidden%20notification/near/244165574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Redundant.20requirements.20hidden.20notification.html#244165574">(Jun 28 2021 at 15:52)</a>:</h4>
<p>It is mostly out of an overabundance of caution. Having that note present signals that you have encountered a potentially recursive obligation. Removing it might leave people in the dark, although I fully grant that the current behavior isn't great either.</p>



<a name="244212348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Redundant%20requirements%20hidden%20notification/near/244212348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> inquisitivecrystal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Redundant.20requirements.20hidden.20notification.html#244212348">(Jun 28 2021 at 22:26)</a>:</h4>
<p>Thanks!</p>



<a name="244213449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Redundant%20requirements%20hidden%20notification/near/244213449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> inquisitivecrystal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Redundant.20requirements.20hidden.20notification.html#244213449">(Jun 28 2021 at 22:38)</a>:</h4>
<p>It seems pretty clear that it at least needs to be rephrased. If there is something that needs to be communicated to the user, "redundant requirements hidden" doesn't really seem to cover it.</p>
<p>In the <a href="https://github.com/rust-lang/rust/blob/70b9d1e102123ca913cf5306079400f753515768/src/test/ui/traits/inductive-overflow/lifetime.stderr#L15">majority</a> of <a href="https://github.com/rust-lang/rust/blob/21185265915d0d472f3f0f54642700c7c693c7d7/src/test/ui/associated-types/impl-wf-cycle-1.stderr#L32">cases</a> where it appears, it doesn't seem like there really is anything to be communicated to the user. The one situation where I think it <em>might</em> do something useful is if there's actually an <a href="https://github.com/rust-lang/rust/blob/21185265915d0d472f3f0f54642700c7c693c7d7/src/test/ui/error-codes/E0275.stderr#L16">infinite loop</a>. It might be worth showing some sort of warning that suggests the possible presence of an infinite loop for very large numbers of recursive obligations. On the other hand,  we don't mention the possibility of an infinite loop for most cases where the recursion limit is reached. Also, it seems like the other lines of the error message probably make the problem reasonably clear, though there maybe some room for improvement. I'm still inclined to remove the message. I don't really know if it's worth trying to handle the infinite loop case seperately or if there are any other situations that I'm not seeing.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>